package heiyan

import (
	"gitee.com/leo-xin/novel_distribution_sdk_go/common/middleware"
	"gitee.com/leo-xin/novel_distribution_sdk_go/heiyan/api"
	"gitee.com/leo-xin/novel_distribution_sdk_go/heiyan/config"
)

type Client struct {
	ApiClient *api.APIClient
}

func Init(cfg *config.Configuration) *Client {
	client := &Client{
		ApiClient: api.NewAPIClient(cfg),
	}
	if cfg.LogEnable {
		client.ApiClient.Use(middleware.LogMiddleware)
	}

	return client
}

func (c *Client) LinkPageApi() *api.LinkPageApiService {
	return c.ApiClient.LinkPageApi
}

func (c *Client) AdvertiseUserApi() *api.AdvertiseUserApiService {
	return c.ApiClient.AdvertiseUserApi
}

func (c *Client) OrderApi() *api.OrderApiService {
	return c.ApiClient.OrderApi

}
